<template>
  <div class="al_aside">
    <ul class="nav_aside">
      <li @click="changePage('ginsenguser')">
        个人资料
      </li>
      <li @click="changePage('index_ginseng_balance')">
        {{gametype}}余额
      </li>
      <li @click="changePage('assetss')">
        我的资产
      </li>
      <li @click="changePage('index_result')">
        炼丹结果
      </li>
      <li @click="changePage('index_gameLog')">
        游戏日志
      </li>
    </ul>
  </div>
</template>

<script>
import $ from "jquery";
export default {
  name: "alchemyNav",
  data() {
    return {
      gametype: u.getStore("winning").bitype
    };
  },
  mounted() {
    this.setShadow();
  },
  methods: {
    setShadow() {
      var path = location.pathname.split("/")[1];
      if (path === "ginsenguser") {
        $(".nav_aside li:eq(0)").css({
          color: "#c7c7c7",
          background:
            'url("' + u.imgurl + 'static/image/bg_btn.png") no-repeat',
          "background-size": "100% 100%"
        });
      } else if (path === "assetss") {
        $(".nav_aside li:eq(1)").css({
          color: "#c7c7c7",
          background:
            'url("' + u.imgurl + 'static/image/bg_btn.png") no-repeat',
          "background-size": "100% 100%"
        });
      }
    },
    changePage(pathname) {
      this.$router.push({ path: "/" + pathname });
      location.reload();
    }
  }
};
</script>

<style>
@import url("../css/base.css");
.nav_aside > li {
  /*position: relative;*/
  background: url(../../static/image/z_7.png) no-repeat scroll top left;
  background-size: 100% 100%;
  height: 45px;
  width: 100%;
  margin-bottom: 15px;
  text-align: center;
  line-height: 40px;
  font-family: "MicrosoftYaHei-Bold";
  font-size: 16px;
  color: #ffffff;
  cursor: pointer;
  text-shadow: 3px 0px 1px rgba(137, 64, 0, 0.75);
}
.al_aside {
  padding: 24px;
  display: inline-block;
  width: 18%;
  height: 957px;
  background: url(../../static/image/ginseng_nav.png) no-repeat scroll top left;
  background-size: 100% 100%;
  vertical-align: top;
}
</style>
